package com.huanshi.exception;

import com.huanshi.common.ResultCode;
import lombok.Getter;

/**
 * 自定义异常
 */
@Getter
public class ServiceException extends RuntimeException {
    private Long code;

    public    ServiceException(Long code, String msg) {
        super(msg);
        this.code = code;
    }

    public ServiceException(ResultCode resultCode) {
        super(resultCode.getMessage());
        this.code = resultCode.getCode();
    }
}
